Skip to content

Conversation

@gustalima
Copy link

If the prop is not provided, it starts from Sunday, keeping the previous behaviour.

If the prop is not provided, it starts from Sunday, keeping the previous behaviour
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In place of explicitly mentioning "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat" | "Sun" everywhere, create a enum for that in calendar.ts file, then you can use it here like

On top -
import type { CalendarEvent, Weeks } from "@/types/calendar";

startOfWeek: Weeks

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use the Weeks enum here as well

On top -
import type { CalendarEvent, Weeks } from "@/types/calendar";

startOfWeek = Weeks.SUNDAY,

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a enum for Weeks here, reference below -

export enum Weeks {
MONDAY = "Mon",
TUESDAY = "Tue",
WEDNESDAY = "Wed",
THURSDAY = "Thu",
FRIDAY = "Fri",
SATURDAY = "Sat",
SUNDAY = "Sun",
}

Then everywhere -
startOfWeek?: "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat" | "Sun"; --> startOfWeek?: Weeks;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same goes for here - startOfWeek?: Weeks;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same goes for here - startOfWeek ?? Weeks.SUNDAY

@yasirmansoori
Copy link
Collaborator

Hey @gustalima 👋,

Thank you so much for this contribution — I really appreciate you not only using the project but also taking the time to open an issue and follow it up with a PR! 🎉

It’s always exciting (and honestly a bit overwhelming in a good way 😄) to see the community grow and contribute actively. Your change to allow setting a fixed starting weekday is a great addition and will definitely help others looking for more control over the calendar view.

Would love to know — how are you using this project? Has it been integrated into something you’re building or working on? Always curious to see the real-world use cases it’s helping with. 😊

Looking forward to more contributions and discussions from you in the future. Thanks again! 🙌

Best,
Yasir

@gustalima
Copy link
Author

Hi @yasirmansoori,

Thanks for your comments on the PR. I'm new to TS, and I have learned from your review. I will make the changes.

On my forked version, I changed the Month and Year view so it can use startOfWeek too (greying out days from previous/past months). I will clean that up and create a second PR.

I'm trying to add an experiment scheduler for one of the apps I have at work, and Eventar was the only suitable option I've found. I need multiple booking providers with different colours (the resources in Eventar's case).

As everything else in my company uses MUI, I'm porting it to MUI v7.
Although we have MUI premium, I only used the Community components, keeping the MUI port free for others to use.

Cheers,
Gustavo

@yasirmansoori
Copy link
Collaborator

Hi @gustalima,

Thanks a lot! I’m really glad Eventar has been useful in your project. Excited to see your upcoming PR and commits. Let me know if you need any help.

Cheers,
Yasir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants